package com.bawei.module_home.banner.bannermodel

import com.bawei.library_base.manager.MyManager
import com.bawei.module_home.banner.bannerbean.BannerBean
import com.bawei.module_home.banner.bannercontract.Api
import com.bawei.module_home.banner.bannercontract.BannerContract
import io.reactivex.Observer
import io.reactivex.Scheduler
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * @date : 2021/12/9
 * @author : zhiyu
 * @content :
 */
class BannerModel:BannerContract.IBannerModel {
    override fun getBannerData(observer: Observer<BannerBean>) {
        MyManager.getInstance().getRetrofit("http://baobab.kaiyanapp.com")
            .create(Api::class.java)
            .getBanner()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribeOn(Schedulers.io())
            .subscribe(observer)
    }

    override fun destroy() {

    }
}